import request from '@/utils/request' // 你自己封装的 axios 实例

export function getHomeworks(params) {
    return request.get('/homeworks', { params })
}

export function getHomeworkDetail(id) {
    return request.get(`/api/homeworks/${id}`)
}

export function createHomework(data) {
    return request.post('/api/homeworks', data)
}

export function deleteHomework1(id) {
    return request.delete(`/api/homeworks/${id}`)
}

export function batchDeleteHomeworks(ids) {
    return request.delete('/api/homeworks', { data: ids })
}

export function copyHomework1(id) {
    return request.post(`/api/homeworks/${id}/copy`)
}

export function extendHomework(id, newDeadline) {
    return request.patch(`/api/homeworks/${id}/extend`, { newDeadline })
}
